package cn.ac.cintcm.prespring.cluster.name;

import org.apache.solr.core.Config;

import cn.ac.cintcm.prespring.cluster.base.Similarity;

/**
 * fangji name similarity based on Longest Common String
 * @author CaoMudan
 *
 */
public class NameSimBasedOnLCS extends NameSimFj{
	private String outputText= Config.getInstanceDir()+ "data/similars/PRES_FJ_NameSimLCS.txt";
	
	public NameSimBasedOnLCS(float simRate) {
		super(simRate);
		super.setOutputText(outputText);
	}

	public boolean isSim(String a,String b){
		return Similarity.isLCSsim(a, b);
	}
	
	public static void main(String[] args) throws Exception{				
		long start=System.currentTimeMillis();
		NameSimFj simFj=new NameSimBasedOnLCS(0.8f);
		simFj.writeSimToText(simFj.calculate(simFj.readFromText()));		
		long end=System.currentTimeMillis();
		System.out.println("use:"+(end-start));
	}		
	
}
